package com.yq.spbYq.service.impl;

import com.yq.spbYq.Reward;
import com.yq.spbYq.mapper.RewardMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RewardService {

    @Autowired
    private RewardMapper rewardMapper;

    public List<Reward> getAllRewards() {
        return rewardMapper.selectAllRewards();
    }

    public Reward getRewardById(Integer rewardId) {
        return rewardMapper.selectRewardById(rewardId);
    }

    public int addReward(Reward reward) {
        return rewardMapper.insertReward(reward);
    }

    public int updateReward(Reward reward) {
        return rewardMapper.updateReward(reward);
    }

    public int deleteRewardById(Integer rewardId) {
        return rewardMapper.deleteRewardById(rewardId);
    }
}